//////////////////////////////////////////////////////////////////////////
#pragma once


//////////////////////////////////////////////////////////////////////////
#include "Math/Math.hpp"


namespace Math
{
	class Point2i
	{
	public:
		// Element index's.
		static const size_t						kXIndex		=	0;
		static const size_t						kYIndex		=	1;

		// Basic type information.
		typedef Point2i							ValueType_t;
		typedef const Point2i&					ParamType_t;

		// Construction.
		Point2i();
		Point2i( const Point2i& rhs );
		Point2i( int32_t x, int32_t y );

		// Accessors.
		int32_t						X() const;
		int32_t						Y() const;
		void						X( int32_t x );
		void						Y( int32_t y );

		// Array accessors.
		int32_t						operator ()( size_t idx ) const;
		void						operator ()( size_t idx, int32_t v );

		// Assignments.
		void						Set( int32_t x, int32_t y );
		const Point2i&				operator =( const Point2i& rhs );

		// Operator overloads.
		Point2i						operator -() const;
		Point2i						operator -( const Point2i& rhs ) const;
		Point2i						operator +( const Point2i& rhs ) const;
		void						operator -=( const Point2i& rhs );
		void						operator +=( const Point2i& rhs );

		// Member functions.
		bool						IsValid() const;

		// Static initializers.
		static const Point2i		Zero();
		static const Point2i		XAxis();
		static const Point2i		YAxis();

	private:
		// Implementation data.
		int32_t						mX;
		int32_t						mY;
	};


	//////////////////////////////////////////////////////////////////////////
	// Helper functions.
	inline Point2i					Multiply( const Point2i& lhs, const Point2i& rhs );
}


// Include the implementations.
#include "Detail/Point2i_Impl.hpp"
